using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ERPBackend.Models
{
    public class EBOMChange : BaseModel
    {
        [Required]
        public int BomId { get; set; }

        [ForeignKey("BomId")]
        public EBOM? EBOM { get; set; }

        [Required]
        [StringLength(50)]
        public string OldVersion { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string NewVersion { get; set; } = string.Empty;

        [Required]
        [StringLength(50)]
        public string ChangeType { get; set; } = string.Empty; // 新增、修改、删除

        public string? ChangeReason { get; set; }

        [Required]
        public int ChangedBy { get; set; }

        [Required]
        public DateTime ChangedTime { get; set; }

        public string? Remark { get; set; }
    }
}